#include <bits/stdc++.h>
#define ll long long
#define pr printf
#define sc scanf
#define N 100005
using namespace std;
int prime[N];
int book[N];
int main()
{
    int num, n, i = 1, j = 1, temp = 1, cnt = 0;
    sc("%d", &n);
    getchar();
    for (num = 2; num <= n; num++)
    {
        if (!book[num]) //欧拉筛部分
            prime[temp++] = num;
        for (i = 1, j = num * prime[i]; prime[i] != 0 && j <= n; i++, j = num * prime[i])
        {
            book[j]++;
            if (num % prime[i] == 0)
                break;
        }
    }
    for (i = 1; i < temp - 1; i++) //统计部分
        if (prime[i + 1] - prime[i] == 2)
            cnt++;
    pr("%d\n", cnt);
    return 0;
}
